
CREATE TABLE daycare.ChildContacts
  (
   ChildContactId INT NOT NULL
               IDENTITY(1,1)
               PRIMARY KEY
 , ChildContactTypeId INT NOT NULL
 , FamilyId INT NOT NULL
 , ChildRelationshipid INT NOT NULL
 , FirstName VARCHAR(100) NOT NULL
 , MiddleName VARCHAR(100) NULL
 , LastName VARCHAR(100) NOT NULL
 , HomePhoneNumber VARCHAR(15)
 , WorkPhoneNumber VARCHAR(15)
 , CellPhoneNumber VARCHAR(15)
 , EmailAddress VARCHAR(100)
 , IsEmergencyContact BIT NOT NULL
 , IsApprovedPickup BIT NOT NULL
 , ImageId INT
 , ReceivesEmailNotifications BIT NOT NULL
 , ReceivesPostalNotifications BIT NOT NULL
 , BillingAddressId INT
 , MailingAddressId INT
  )
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_Images FOREIGN KEY(ImageId) REFERENCES daycare.Images(ImageId)
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_Families FOREIGN KEY(FamilyId) REFERENCES daycare.Families(FamilyId)
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_ChildRelationships FOREIGN KEY(ChildRelationshipId) REFERENCES daycare.ChildRelationships(ChildRelationshipId)
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_ChildContactTypeId FOREIGN KEY(ChildContactTypeId) REFERENCES daycare.ChildContactTypes(FamilyId)
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_Addresses-Billing FOREIGN KEY(BillingAddressId) REFERENCES daycare.Addresses(AddressId)
ALTER TABLE daycare.Adults ADD CONSTRAINT FK_Adults_Addresses-Mailing FOREIGN KEY(MailingAddressId) REFERENCES daycare.Addresses(AddressId)
GO